#include <set>
#include <vector>
using namespace std;

class Solution {
  public:
    int maxPerformance(int n, vector<int>& speed, vector<int>& efficiency, int k) {
        std::set<int> chosed;
        int result = 0;
        int min_speed_index = 0;
        int min_speed = 0;
        int min_efficiency_index = 0;
        int min_efficiency = 0;
        for (int i = 0; i < k; ++i) {
            if (speed[i] < min_speed) min_speed = speed[i], min_speed_index = i;
            if (efficiency[i] < min_efficiency) min_efficiency = efficiency[i], min_efficiency_index = i;
            chosed.insert(i);
        }
        result = sum(speed, chosed, min_efficiency);
        for (int i = k; i < speed.size(); ++i) {
            if (speed[i] > min_speed) {
            }
        }
    }

    int sum(std::vector<int>& speed, std::set<int> chosed, int min_efficiency) {
        int sum = 0;
        for (auto s : speed) sum += s;
        return (sum * min_efficiency);
    }
};
